package Java1Test.ArrayList;


import java.util.ArrayList;


public class ArrayListTest2 {
    public static void main(String[] args) {
        ArrayList<Student1> list = new ArrayList<>();
        Student1 s1 = new Student1("wangwu", 25);
        Student1 s2 = new Student1("lisi", 4);
        Student1 s3 = new Student1("zhangsan", 3);

        list.add(s1);
        list.add(s2);
        list.add(s3);


        for (int i = 0; i < list.size(); i++) {
            Student1 s = list.get(i);
            System.out.print(s.getName() + s.getAge());


        }

    }
}
